package com.hgw.Demo01_ChainOfResponsibilityPattern.ChainOfResponsibilityPattern;

/**
 * Data time:2021/12/16 12:24
 * StudentID:2019112118
 * Author:hgw
 * Description:
 */
public class Client {

    public static void main(String[] args) {
        Handler handler1,handler2,handler3;
        handler1 = new ConcreteHandler();
        handler2 = new ConcreteHandler();
        handler3 = new ConcreteHandler();
        // 创建职责链
        handler1.setSuccessor(handler2);
        handler2.setSuccessor(handler3);
        // 发送请求，请求对象通常为自定义类型
        handler1.handleRequest("请求对象");
    }

}
